# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=mara-framework
pkgver=176.ac4ac88
pkgrel=3
pkgdesc='A Mobile Application Reverse engineering and Analysis Framework.'
groups=('blackarch' 'blackarch-mobile' 'blackarch-reversing'
        'blackarch-disassembler')
arch=('any')
url='https://github.com/xtiankisutsa/MARA_Framework'
license=('GPL3')
depends=('bash' 'tree' 'git' 'gtk2' 'python2' 'python3' 'java-environment'
         'figlet' 'python2-pydot')
makedepends=('git')
source=("$pkgname::git+https://github.com/xtiankisutsa/MARA_Framework.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md documentation/*
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm -rf documentation README.md LICENSE

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec sh mara.sh "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

